import request from '@/axios'

//获取枚举数据
export const getEnumApi = (params?: any) => {
  return request.get({ url: '/admin/wholesalAssets/resource', params })
}
//获取经销商枚举数据
export const getDistributorEnumApi = (params?: any) => {
  return request.get({ url: '/admin/customer/select', params })
}
//获取列表数据
export const getListApi = (params?: any) => {
  return request.get({ url: '/admin/wholesalAssets', params })
}
//获取快递运费数据
export const getFreightApi = (data?: any) => {
  return request.post({ url: `/admin/LogisticsRules/logisticsFee`, data })
}
//获取自提地址数据
export const getPickUpAddressApi = (id: string | number, params?: any) => {
  return request.get({ url: `/admin/warehouse/${id}`, params })
}
//获取收货地址列表数据
export const getDeliveryAddressListApi = (params?: any) => {
  return request.get({ url: '/admin/address', params })
}
//创建发货
export const createDataApi = (data) => {
  return request.post({ url: '/admin/wholesalOrder/deliver', data })
}
//获取国家枚举数据
export const getCountryEnumApi = (params?: any) => {
  return request.get({ url: '/admin/region/country', params })
}
//获取区枚举数据
export const getAreaEnumApi = (params?: any) => {
  return request.get({ url: '/admin/region/area', params })
}
//更新地址信息
export const editAddressInfoApi = (data): Promise<IResponse> => {
  return request.put({ url: '/admin/address', data })
}
//新增地址信息
export const createAddressInfoApi = (data) => {
  return request.post({ url: '/admin/address', data })
}
